﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Silvermoon.Windows.Styles;
using Silvermoon.Shapes;
using Silvermoon.Windows;
using Passwords.Utils;
using Silvermoon.OpenGL;
using Silvermoon.Controls;
using Silvermoon.OpenGL.Native;
using Silvermoon.UI;

namespace Passwords
{
    public static class StylePool
    {
        public static readonly StyleDictionary Metro = new MetroStyles();

        public static readonly Style Window = new Style
        {
            Background = new GradientStopShape(0, 2,
                new GradientStop(0, 255, 0, 0, 0),
                new GradientStop(1, 255, 0, 0, 100), 
                //new GradientStop(1, PhoneColors.Black.AlphaBlend(PhoneColors.Accent,100).SwapRB()),
                new GradientStop(2, 255, 0, 0, 0))
        };

        public static readonly Style BrownGradient = new Style
        {
            Background = new GradientStopShape(0, 2, new GradientStop(0, PhoneColors.Black), new GradientStop(1, PhoneColors.Brown), new GradientStop(2, PhoneColors.Black))

        };

        public static readonly Style RedGradient = new Style
        {
            Background = new GradientStopShape(0, 1, new GradientStop(0, PhoneColors.Black), new GradientStop(1, PhoneColors.Red))

        };

        public static readonly Style DarkEditWindow = new Style
        {
            Background = new GradientStopShape(0, 800,
                new GradientStop(0, PhoneColors.MediumDark),
                new GradientStop(400, PhoneColors.Black),
                new GradientStop(720, PhoneColors.Dark),
                new GradientStop(800, 255, 0, 0, 0))
        };

        public static readonly Style EditWindow = new Style
        {
            Background = new GradientStopShape(0, 800,
                new GradientStop(0, 255, 0, 0, 0),
                new GradientStop(400, PhoneColors.MediumDark),
                new GradientStop(720, 255, 0, 0, 0),
                new GradientStop(800, 255, 0, 0, 0))
        };

        public static readonly Style ContactWindow = new Style
        {
            Background = new GradientStopShape
            {
                Orientation = Orientation.Landscape,
                End = 2,
                GradientStops =
                    new GradientStop[]
                {
                      new GradientStop(0,255,0,0,0),
                      new GradientStop(1,255,0,0,100),
                      new GradientStop(2,255,0,0,0)
                }
            }
        };


        public static readonly Style Login = new Style
        {
            Background = new GradientStopShape
           {
               GradientStops = new GradientStop[] { 
                    new GradientStop(0, 255,0,0,0),
                    //new GradientStop(1, 255,0,100,0),
                    new GradientStop(1, PhoneColors.Lime),
                    new GradientStop(2, 255,0,0,0),
                    new GradientStop(3, 255,0,0,0)
                },
               Start = 0,
               End = 3
           }
        };

        public static readonly LabelStyle SmallDebugLabel = new LabelStyle
        {
            TextColor = PhoneColors.Accent,
            FontScale = 0.8f,
            LineAlignment = Alignment.Near,
            Alignment = Alignment.Far,
            Margin = Margin.Zero
        };

        public static readonly LabelStyle LargeDebugLabel = new LabelStyle
        {
            Font = FontCache.BigRegularFont,
            LineAlignment = Alignment.Far,
            Alignment = Alignment.Far,
            Margin = Margin.Zero
        };

        public static readonly Style DarkSelectionItem = new TextItemStyle { TextColor = PhoneColors.Medium, StateManager = ItemStateManagers.ItemManagerWhiteSelection };

        public static readonly Style TitleLabel = new LabelStyle { Font = FontCache.BigRegularFont, FontScale = 1.5f, Alignment = Alignment.Near };

        public static readonly Style TextItemStyle = new TextItemStyle { Font = FontCache.BigRegularFont };

        public static readonly Style PickerItemStyle = new TextItemStyle
        {
            Font = FontCache.BigRegularFont,
            //Chrome = new BorderShape(2, new GlColor(128, 255, 255, 255)),
            Background = PhoneColors.Medium,
            Color = PhoneColors.Dark,
            Margin = new Margin(10, 5, 10, 5)
        };

        public static readonly Style LabelIndexPickerStyle = new Style
        {
            StateManager = new VisualStateManager(),
            TextColor = PhoneColors.White,
            Opacity = 255,
        };


    }
}
